<?php // no direct access
defined('_JEXEC') or die('Restricted access'); 

$db = &Jfactory::GetDBO();
$query = "SELECT * FROM jos_banner WHERE catid=6 AND showBanner=1"; 
$db->setQuery($query);
$array = $db->loadObjectList(); 

?>

<section id="main" class="home">
                        	<!--Welcome banner-->
                            <div id="welcome">
                                <div id="slider">    
								<?php 
								
								for($i =0;$i<count($array);$i++){ ?>							
                                    <a href="index.php?option=com_content&view=article&id=<?php echo $array[$i]->clickurl ?>&Itemid=1"><img src="images/thumb/timthumb.php?src=images/banners/<?php echo $array[$i]->imageurl ?>&w=960&h=303&zc=1" alt="" /></a>								
									<?php }?>
									
                                </div> <!-- end slider -->
                                <div class="welcome-bg"></div>
                                <div class="welcome fl-left">
								<?php 		
									$query1 = "SELECT * FROM jos_content WHERE id =20";
									$db->setQuery($query1);
									$row = $db->loadObject();								
								?>
                                	<h1><?php echo $row->title ?></h1>
                                   <?php echo $row->introtext ?>
									<a class="more"  href="om_os.html">Læse mere</a>
                                </div>
                            </div>
							
							<?php 
									$query2 = "SELECT * FROM jos_content WHERE catid=3 AND state=1 order by ordering LIMIT 0,4";
									$db->setQuery($query2);			
									$row3 = $db->loadObjectList();			
							?>
                            <!-- Begin main-content  -->
                            <div id="content">
                                <h1 class="page-title">SG RENGØRING ApS SERVICES</h1>
                                <!-- Begin corporate structure  -->
                                <div class="content-ctn">
                                	<div id="serviceList">
									<?php for($k=0;$k<count($row3);$k++) {?>
                                        <div class="box-decor">
                                            <h2><?php echo $row3[$k]->title?></h2>
                                            <a class="service-img" href="index.php?option=com_content&view=article&id=<?php echo $row3[$k]->id;?>"><img src="images/thumb/timthumb.php?src=<?php echo $row3[$k]->article_image ?>&w=227&h=101&zc=1" alt="<?php echo $row3[$k]->title ?>" class="bor3" /></a>
											<?php echo $row3[$k]->introtext ?>										
                                            <a class="mere-link" href="index.php?option=com_content&view=article&id=<?php echo $row3[$k]->id ?>">Mere</a>
                                        </div>
								<?php }?>
                                    </div>
                                </div>
                                <!-- / corporate structure  -->
                                
                            </div>
                            <!-- / main-content  -->
                              
                            <!-- /end mid-content  -->
							<?php	
									$query1 = "SELECT * FROM jos_banner WHERE catid=8 AND showBanner=1";
									$db->setQuery($query1);
									$row1 = $db->loadObjectList(); 
									//var_dump($row1);
									?>
                            <div id="referencer">
                            	<h2>Referencer</h2>
                            	<div class="referencer-list">
                                	<ul>
									<?php  for($j=0;$j<count($row1);$j++){?>
									
                                    	<li><a href="http://<?php echo $row1[$j]->clickurl ?>" target="_blank" title="<?php echo $row1[$j]->description ?>"><img src="images/banners/<?php echo $row1[$j]->imageurl ?>" alt=""/></a></li>
                                     
										<?php }?>
                                    </ul>
                                	
                                </div>
                            </div>
</section>
					